import 'package:backend.core/core/domain/entities/api/app_store/api_app_store_purchased_subscription_expiration_reason.dart';
import 'package:backend.core/core/domain/entities/app_store/app_store_purchased_subscription_expiration_reason.dart';

abstract class CreateApiAppStorePurchasedSubscriptionExpirationReasonFromInternalOne {
  ApiAppStorePurchasedSubscriptionExpirationReason call({
    required AppStorePurchasedSubscriptionExpirationReason expirationReason,
  });
}

class CreateApiAppStorePurchasedSubscriptionExpirationReasonFromInternalOneImpl
    implements CreateApiAppStorePurchasedSubscriptionExpirationReasonFromInternalOne {
  const CreateApiAppStorePurchasedSubscriptionExpirationReasonFromInternalOneImpl();

  @override
  ApiAppStorePurchasedSubscriptionExpirationReason call({
    required AppStorePurchasedSubscriptionExpirationReason expirationReason,
  }) {
    switch (expirationReason) {
      case AppStorePurchasedSubscriptionExpirationReason.customerCancellation:
        return ApiAppStorePurchasedSubscriptionExpirationReason.customerCancellation;
      case AppStorePurchasedSubscriptionExpirationReason.billingError:
        return ApiAppStorePurchasedSubscriptionExpirationReason.billingError;
      case AppStorePurchasedSubscriptionExpirationReason.priceIncrease:
        return ApiAppStorePurchasedSubscriptionExpirationReason.priceIncrease;
      case AppStorePurchasedSubscriptionExpirationReason.unavailablePurchase:
        return ApiAppStorePurchasedSubscriptionExpirationReason.unavailablePurchase;
    }
  }
}
